//
//  WebViewController.m
//  ZIVSetView
//
//  Created by ziv on 16/9/8.
//  Copyright © 2016年 Ziv. All rights reserved.
//

#import "WebViewController.h"

@interface WebViewController ()

@end

@implementation WebViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.

 self.navigationItem.title = @"帮助中心";
    [self loadData];
}
- (void)loadData
{
    
    UIWebView *wv = [[UIWebView alloc]initWithFrame:self.view.bounds];
    
    // 1. URL
//    NSURL *URL = [NSURL URLWithString:@"https://yi.baidu.com/pc/hospital/index?zt=pcdyyy&key=%E4%B8%AD%E5%9B%BD%E4%BA%BA%E6%B0%91%E8%A7%A3%E6%94%BE%E5%86%9B%E6%80%BB%E5%8C%BB%E9%99%A2"];
    
    NSURL *URL = [NSURL URLWithString:@"http://www.pumch.cn"];
    
    
    
    NSURLRequest *requestM = [NSURLRequest requestWithURL:URL];
    [wv loadRequest:requestM];
//    
    wv.scalesPageToFit =YES;
    [self.view addSubview:wv];
   //[requestM setValue:@"iphone AppleWebKit" forHTTPHeaderField:@"User-Agent"];
  
    
//    [NSURLConnection sendAsynchronousRequest:requestM queue:[NSOperationQueue mainQueue] completionHandler:^(NSURLResponse * _Nullable response, NSData * _Nullable data, NSError * _Nullable connectionError) {
//        
//        
//        // 处理响应
//        if (connectionError == nil && data != nil) {
//            //            NSLog(@"%@ -- %@",response,data);
//            
//            NSString *html = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
//            
//            
//            
//            [wv loadHTMLString:html baseURL:URL];
//            
//        } else {
//            NSLog(@"%@",connectionError);
//        }
//    }];
////}
}

@end
